package com.ciaojian.worker.controller;

import com.ciaojian.core.service.WorkerAuthorityService;
import com.ciaojian.core.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author cano
 */
@Api(tags = "排班物资选择")
@RestController
@RequestMapping("/authority")
public class WorkerAuthorityController {
    @Resource
    private WorkerAuthorityService workerAuthorityService;

    @ApiOperation("排班物资选择列表")
    @GetMapping
    public Result getAuthorityGroup(@RequestParam(value = "workerId",required = false,defaultValue = "0") @ApiParam("员工id") Integer workerId,
            @RequestParam(value = "type", required = false,defaultValue = "0") @ApiParam("类型 0排班 1物资") Integer type) {
        return workerAuthorityService.getAuthorityGroup(workerId,type);
    }
}
